#ifndef THREAD_DETECTION_H
#define THREAD_DETECTION_H

#include <QThread>
#include <QMainWindow>
#include <QtNetwork/QHostAddress.h>
#include <winsock2.h>
#include <QVector>

typedef struct{
    long int nAdresse;
    unsigned int nNbreBroadcastAdresse;
}InfoBroadcast;

class Thread_Detection : public QThread
{
    Q_OBJECT
public:
    explicit Thread_Detection(QObject *parent = 0);
    virtual ~Thread_Detection();

private:
    HOSTENT * RecupererIpSource(ULONG * p_addr);
    HOSTENT * RecupererIpDestination(const char * name, ULONG * p_addr);
    int enable_rcvall(SOCKET s);
    void Determination(void * buffer);
    QVector <InfoBroadcast> TableauInfoBroadcast;
    QTimer * TimerThread;

protected:
    virtual void run();

signals:
    void Signal_AdresseProblematique(QString);
    void Signal_NbreBroadcastEmis(int);
    void Signal_Afficher(int) ;
public slots:
    void TimeOut_Slot() ;

};

#endif // THREAD_DETECTION_H
